package cn.ivicar.config;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ClassPathImpl implements ConfigIntf {
    public InputStream getResourceAsStream(String filePath) throws FileNotFoundException {
        return ClassPathImpl.class.getClassLoader().getResourceAsStream(filePath);
    }

    public Properties getResourceAsProperties(String filePath) throws IOException {
        Properties props = new Properties();
        InputStream in = getResourceAsStream(filePath);
        if (in == null) {
            return null;
        }

        props.load(in);

        return props;
    }

    public String[] getPropertyFiles() {
        return null;
    }
}
